﻿/**********************************************************************
 * @file   FITKAcousticsVTKGraphObjectFESubSystems.h
 * @brief  FE子系统渲染基类
 * @author BaGuijun (baguijun@163.com)
 * @date   2025-01-02
 *********************************************************************/
#ifndef FITKAcousticsVTKGraphObjectFESubSystems_H_
#define FITKAcousticsVTKGraphObjectFESubSystems_H_

#include "FITKAcousticsVTKGraphAdaptorAPI.h"
#include "FITKAcousticsVTKGraphObjectMergedData.h"

#include "FITK_Component/FITKAcousticsModel/FITKAbstractFESubSys.h"

namespace Acoustics {
    class FITKAcousticsFEModel;
    class FITKAcousticsFESubSysManager;
}

namespace Exchange 
{
    /**
     * @brief  FE子系统渲染基类
     * @author BaGuijun (baguijun@163.com)
     * @date   2025-01-02
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectFESubSystems :public FITKAcousticsVTKGraphObjectMergedData
    {
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectFESubSystems, FITKAcousticsVTKGraphObjectMergedData);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectFESubSystems);
    public:
        /**
         * @brief    构造函数
         * @param[i] model              FE模型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-02
         */
        FITKAcousticsVTKGraphObjectFESubSystems(Acoustics::FITKAcousticsFEModel* model);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-02
         */
        virtual ~FITKAcousticsVTKGraphObjectFESubSystems();
        /**
         * @brief    更新数据
         * @param[i] dataId                      数据ID
         * @param[i] forceUpdate                 是否强制更新
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-30
         */
        virtual void updateById(int dataId, bool forceUpdate = false) override;
        /**
         * @brief    更新可见性
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-15
         */
        virtual void updateVisibility() override;
        /**
         * @brief    更新颜色
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-31
         */
        virtual void updateByDataColor() override;
        /**
         * @brief    根据单元id获取对应的数据id
         * @param[i] vtkId                        单元id
         * @param[i] topAbsShapeType
         * @return   int                          数据id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-03
         */
        virtual int getShapeIdByVTKCellId(int vtkId, FITKAcousticsVTKCommons::ShapeMeshAbsEnum topAbsShapeType) override;
        /**
         * @brief    高亮渲染对象
         * @param[i] hightObjID                     高亮数据id【仅复合数据使用】
         * @param[i] type                           需要突出显示形状类型
         * @param[i] color                          高亮颜色
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-05
         */
        void highlight(int hightObjID = -1, FITKAcousticsVTKCommons::ShapeType type = FITKAcousticsVTKCommons::ShapeTypeNone, QColor color = QColor()) override;
        /**
         * @brief    取消高亮渲染对象
         * @param[i] hightObjID                     取消高亮数据id【仅复合数据使用】
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-05
         */
        void disHighlight(int hightObjID = -1) override;
    protected:
        /**
         * @brief    初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-02
         */
        void init() override;
    protected:
        /**
         * @brief  FE子系统管理器
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-01-02
         */
        Acoustics::FITKAcousticsFESubSysManager* m_feSubManager = nullptr;
        /**
         * @brief  子系统类型
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-27
         */
        Acoustics::FITKAbstractFESubSys::FESubSysType m_FESubSysTypeEnum = Acoustics::FITKAbstractFESubSys::FESubSysType::FENone;
        /**
         * @brief  子系统类型(1：FE梁结构、2：FE板结构、3：FE声腔)
         * 主要用于区分FE梁结构与FE板结构
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-27
         */
        int m_FESubSysTypeInt = -1;
    };
}

#endif
